package com.alipear.shopcredit.common.view.wrapper;

import android.widget.ProgressBar;
import android.widget.Toast;

import com.alipear.serverrequest.DialogResponseHandler;
import com.alipear.serverrequest.RequestProgressInterface;
import com.alipear.serverrequest.item.BaseResult;
import com.alipear.uibase.ExternActivityInterface;

/**
 * Created by zoulinlin on 2015/3/27.
 */
public abstract class CommonDialogResponseHandle<T extends BaseResult> extends DialogResponseHandler<T> {

    public CommonDialogResponseHandle(ExternActivityInterface externInterface, RequestProgressInterface userProgress) {
        super(externInterface, userProgress);
    }

    public CommonDialogResponseHandle(ExternActivityInterface externInterface) {
        super(externInterface);
    }

    public CommonDialogResponseHandle(ExternActivityInterface externInterface, ProgressBar progressbar) {
        super(externInterface, progressbar);
    }

    @Override
    public void onRequestFailed(String errMessage) {
        if (mExternInterface != null && mExternInterface.getCurActivity() != null) {
            Toast.makeText(mExternInterface.getCurActivity(), errMessage, Toast.LENGTH_LONG).show();
        }
    }
}
